import {request} from '@/utils/request';

/**
 * 添加设备
 * @param data 数据
 */
export function insertDeviceApi(data: any) {
  return request({
      url: '/bms/device/insertBmsDevice',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    });
}

/**
 * 修改设备
 * @param data 数据
 */
export function modifyDeviceApi(data: any) {
  return request({
      url: '/bms/device/modifyBmsDevice',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    });
}

/**
 * 查询设备
 * @param data 数据
 */
export function findDeviceByIdApi(data: any) {
  return request({
      url: '/bms/device/findById',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    });
}

/**
 * 获取设备列表
 * @param data 查询条件
 */
export function listDevicePageApi(data: any) {
  return request({
      url: '/bms/device/findBmsDevicePageList',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    });
}

/**
 * 获取设备维修记录列表
 * @param data 查询条件
 */
export function listDeviceRepairApi(data: any) {
  return request({
      url: '/bms/device/repair/listDeviceRepair',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    });
}

/**
 * 查询指定设备
 * @param data 查询条件
 */
export function findByIdApi(data: any) {
  return request({
      url: '/bms/device/findById',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    });
}

/**
 * 添加设备绑定关系
 * @param data 查询条件
 */
export function insertDeviceRelationApi(data: any) {
  return request({
      url: '/bms/device/relation/public/insertBatch',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    });
}

/**
 * 获取设备列表
 * @param data 查询条件
 */
export function listDeviceRelationApi(data: any) {
  return request({
      url: '/bms/device/relation/public/findList',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    });
}

/**
 * 删除公共绑定
 * @param data 查询条件
 */
export function deletePublicApi(data: any) {
  return request({
      url: '/bms/device/relation/public/delete',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    });
}

/**
 * 获取设备床位绑定关系
 * @param data 查询条件
 */
export function listDeviceBedRelationApi(data: any) {
  return request({
      url: '/bms/device/relation/bed/findListByBed',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    });
}

/**
 * 添加床位设备绑定关系
 * @param data 查询条件
 */
export function insertBatchApi(data: any) {
  return request({
      url: '/bms/device/relation/bed/insertBatch',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    });
}

/**
 * 添加床位设备绑定关系
 * @param data 查询条件
 */
export function deleteBedApi(data: any) {
  return request({
      url: '/bms/device/relation/bed/delete',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    });
}